<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
            分析:
                1. fn => function fn(){}
                2. num = 10;
                3. fn1 => funtion fn1(){}
                4. num = 20
                //两个num都没有使用var来进行声明,那么表示num是一个全局变量,都可以访问
        */
        function fn(){
            num = 10;
            function fn1(){
                num = 20;
            }
            fn1();
        }
        fn();
        console.log(num);//20
    </script>
</body>
</html>